<template>
	<view>
		<!-- 作品集组件 -->
		<view style="width: 90%;margin: auto;margin-bottom: 40rpx;">
			<opusMap :list="opusMapList" :title="opusMapTile" :flag="true" :userId="userId"></opusMap>
		</view>
		<view>
			<dynamicList :list="list" :initial-value.sync="list"></dynamicList>
		</view>
	</view>
</template>

<script>
	export default {
		name: "dynamic",
		props:{
			userId:{
				type:Number,
				required: true
			}
		},
		data() {
			return {
				list: [],
				opusMapTile: '作品集',
				opusMapList: [],
			}
		},
		mounted() {
			this.getDynamicList();
			this.getList()
		},
		onShow() {
			// 这里可以处理子页面返回后的逻辑
			this.getList();
		},
		methods: {
			getList() {
				this.$api.getList({
					uuid:this.userId
				}).then(res => {
					this.opusMapList=res.data;
					console.log("this.opusMapList", this.opusMapList)
				})
			},
			// 获取动态列表
			getDynamicList() {
				this.$api.getDynamicList({
					page: '',
					limit: '',
					uuid:this.userId
				}).then(res => {
					console.log("res", res);
					this.list = res.data.data;
				})
			},
		}
	}
</script>

<style>
</style>